import request from '@/utils/request'

export function fileChannelTable(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/file/channel/table`,
    method: 'post',
    data: query
  })
}

export function fileChannelLoad(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/file/channel/load`,
    method: 'get',
    params: query
  })
}

export function fileChannelSave(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/file/channel/save`,
    method: 'post',
    data: query
  })
}

export function fileChannelDelete(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/file/channel/delete`,
    method: 'post',
    data: query
  })
}

export function fileManageTable(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/file/manage/table`,
    method: 'post',
    data: query
  })
}

export function fileManageDelete(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/file/manage/delete`,
    method: 'post',
    data: query
  })
}

export function fileTable(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/file/manage/fileTable`,
    method: 'post',
    data: query
  })
}

export function fileTreeData(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/file/manage/treeData`,
    method: 'post',
    data: query
  })
}

export function loadFile(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/file/manage/load`,
    method: 'get',
    params: query
  })
}

export function fileSize(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/file/manage/size`,
    method: 'post',
    data: query
  })
}

export function uploadFile(formData) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/public/file/upload`,
    cache: false,
    processData: false,
    contentType: false,
    method: 'post',
    data: formData
  })
}

export function deleteFile(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/public/file/delete`,
    cache: false,
    method: 'post',
    data: query
  })
}

export function moveFile(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/file/manage/move`,
    method: 'post',
    data: query
  })
}

export function unzipFile(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/file/manage/unzip`,
    method: 'post',
    data: query
  })
}

export function createFolder(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/file/manage/create`,
    method: 'post',
    data: query
  })
}

export function mergeChunkFile(query) {
  return request({
    url: `${process.env.VUE_APP_MODULE_ADMIN_API}/api/file/chunk/merge`,
    method: 'post',
    contentType: 'json',
    data: query
  })
}
